package com.manor.paradise.activity

import android.content.Intent
import com.gyf.immersionbar.ktx.immersionBar
import com.manor.common.activity.AbsActivity
import com.manor.common.constant.IntentKey.Companion.DESCRIPTION
import com.manor.common.utils.ActivityManager
import com.manor.common.utils.v
import com.manor.paradise.R
import kotlinx.android.synthetic.main.lyb_activity_active_explain.*
import kotlinx.android.synthetic.main.lyb_activity_my_active.mTitleBarLayout

class LybActiveExplainActivity : AbsActivity() {
    override fun getLayoutId() = R.layout.lyb_activity_active_explain
    override fun main() {
        super.main()
        immersionBar {
            statusBarColor(R.color.white)
            titleBar(mTitleBarLayout)
            statusBarDarkFont(true)
        }
        val type = intent.getIntExtra(DESCRIPTION, 0)
        if (type == 0){
            setTopTitle("活跃度说明")
            mActiveLayout.v(true)
            mMiAndPowerLayout.v(false)
            mContributionValueLayout.v(false)
        }else if (type == 1){
            setTopTitle("米粒能量说明")
            mActiveLayout.v(false)
            mMiAndPowerLayout.v(true)
            mContributionValueLayout.v(false)
        }else{
            setTopTitle("贡献值说明")
            mContributionValueLayout.v(true)
            mActiveLayout.v(false)
            mMiAndPowerLayout.v(false)
        }
    }
    companion object{
        fun launch(type: Int = 0){
            val activity = ActivityManager.getInstance().currentActivity()
            val intent = Intent(activity, LybActiveExplainActivity::class.java)
            intent.putExtra(DESCRIPTION, type)
            activity.startActivity(intent)
        }
    }
}